<!DOCTYPE html>
 <html>
 <head>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <% include("/view/console/common/css.html"){}	%>

 <title></title>
 </head>
 <body>
 <div class="zq-form">
 <form name="boTest_form"  id="boTest_form" class="form-horizontal" style="margin-bottom: 70px;">
   <div class="form-group" >
 <label class="col-sm-2 col-xs-2 control-label">姓名</label>
 <div class="col-sm-6 col-xs-6">
 <input  type="text"  name="name" id="name" class="form-control" check-type="" maxlength='10' value='${boTest.name!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 col-xs-2 control-label">出生日期</label>
 <div class="col-sm-6 col-xs-6">
 <input  type="text"  name="birthday" id="birthday" class="form-control" check-type=""  value='${boTest.birthday!,"yyyy-MM-dd HH:mm:ss"}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 col-xs-2 control-label">年龄</label>
 <div class="col-sm-6 col-xs-6">
 <input  type="text"  name="age" id="age" class="form-control" check-type=" number"  value='${boTest.age!}' >
 </div>
  </div>
 <div class="form-group" >
 <label class="col-sm-2 col-xs-2 control-label">描述</label>
 <div class="col-sm-6 col-xs-6">
   <textarea name="des" id="des" placeholder="请输入内容" check-type="" maxlength='255' class="layui-textarea">${boTest.des!}</textarea></div>
  </div>
 <div class="form-group">
 <label class="control-label col-sm-2 col-xs-2">性别</label>
 <div class="col-sm-6 col-xs-6">
 	<select class="form-control" id="sex"
 		name="sex" check-type="" maxlength='255'>
 </select>
 </div>
 </div>
 <div class="form-group" >
 <label class="col-sm-2 col-xs-2 control-label">描述</label>
 <div class="col-sm-6 col-xs-6">
   <textarea name="html" id="html" placeholder="请输入内容" check-type=""  class="layui-textarea">${boTest.html!}</textarea></div>
  </div>
  <div class="form-group" >
 <label class="col-sm-2 col-xs-2 control-label">头像</label>
 <div class="col-sm-3 col-xs-3">
   <span class="btn btn-success fileinput-button">
        <i class="glyphicon glyphicon-plus"></i>
        <span>添加</span>
  <input type="file" id="imgUrl_file" class="form-control" value='${boTest.imgUrl!}' >
  <input type="hidden" id="imgUrl"  name="imgUrl"class="form-control" value='${boTest.imgUrl!}' >
    </span>
  <div id="imgUrl_progress" class="progress">
   <div class="progress-bar progress-bar-success"></div>
  </div>
  </div>
   	<div class="col-sm-4 col-xs-4">
   	<img id="imgUrl_file_show" src="${boTest.imgUrl!}" style="width:100px;word-wrap: break-word;" alt="图片" class="img-rounded">
 </div>
 </div> <div class="form-group" >
 <label class="col-sm-2 col-xs-2 control-label">个人档案</label>
 <div class="col-sm-3 col-xs-3">
   <span class="btn btn-success fileinput-button">
        <i class="glyphicon glyphicon-plus"></i>
        <span>添加</span>
  <input type="file" id="fileMy_file" class="form-control" value='${boTest.fileMy!}' >
  <input type="hidden" id="fileMy"  name="fileMy"class="form-control" value='${boTest.fileMy!}' >
    </span>
  <div id="fileMy_progress" class="progress">
   <div class="progress-bar progress-bar-success"></div>
  </div>
  </div>
   	<div class="col-sm-4 col-xs-4">
   		<a id="fileMy_file_show" href="${boTest.fileMy!}" style="width:100px;word-wrap: break-word;" >${boTest.fileMy!}</a>
 </div>
 </div>

   <script type="text/javascript"> 
 </script>
   <input type='hidden' name='id' id='id' value='${boTest.id!}'><input type='hidden' name='common_token' id='common_token' value='${common_token!}'>
 </form>
  <nav class="navbar navbar-default navbar-fixed-bottom" style="text-align: right">
    <a href="#" class="btn btn-success" style="margin:10px" id = "saveForm">保存 </a>
  </nav>
 </div>
 <% include("/view/console/common/js.html"){} 	%>
 <script>


    layui.use(['layer','laydate'], function(){
    var laydate = layui.laydate;
    var layer = layui.layer;
    /*开启表单验证*/
    $("#boTest_form").validation();
          laydate.render({
    elem: '#birthday',
    type: 'datetime'
    ,format: 'yyyy-MM-dd HH:mm:ss'
  });   componentSelectInit(      
            {                        
                    ctxPath:'',       
           tableName:"sys_dictionary",        
           showValueField:"name",             
           valueField:"value",                 
 selectId:"sex"  ,      
           where:" where code ='sex' "     
                              }              
                              ,function(){   
   $('#sex').val("${boTest.sex!}");           
  });                         
 var htmlEdit = CKEDITOR.replace( 'html' );consoleUploadAliImg('imgUrl','');

 consoleUploadAliFile('fileMy','');



    $("#saveForm").click(function(){
        saveZqForm();

    })
    function saveZqForm(){
        if ($("#boTest_form").valid() == false) {
        return false;
        }
        var formObject=new Object();
        formObject.name=$('#name').val()==''?null:$('#name').val(); 
 formObject.birthday=$('#birthday').val()==''?null:$('#birthday').val(); 
 formObject.age=$('#age').val()==''?null:$('#age').val(); 
 formObject.imgUrl=$('#imgUrl').val()==''?null:$('#imgUrl').val(); 
 formObject.des=$('#des').val()==''?null:$('#des').val(); 
 formObject.sex=$('#sex').val()==''?null:$('#sex').val(); 
 formObject.fileMy=$('#fileMy').val()==''?null:$('#fileMy').val(); 
 formObject.html=htmlEdit.getData(); 
 formObject.id=$('#id').val()==''?null:$('#id').val(); 
 
        var formObjectJson = JSON.stringify(formObject);
        $.post("/console/bo_test/save",
        {
        formObjectJson :formObjectJson,
        common_token :$("#common_token").val()
        }, function(data) {
        layer.alert(data.message, {skin: 'layui-layer-molv',closeBtn: 0 }, function(){
        parent.$("#boTest").bootstrapTable("refresh");
        parent.layer.closeAll();
        });

        });
        }
    });

 </script>
 </body>
